import ajax from '../utils/request.js'

// 获取图片
function getimage (params, type) {
  if (type) {
    return ajax({
      url: '/mp/v1_0/user/images?collect=true',
      params
    })
  } else {
    return ajax({
      url: '/mp/v1_0/user/images',
      params
    })
  }
}

// 收藏图片
function collection (id, data) {
  return ajax({
    url: '/mp/v1_0/user/images/' + id,
    method: 'put',
    data
  })
}

// 删除图片
function getdelete (id) {
  return ajax({
    url: '/mp/v1_0/user/images/' + id,
    method: 'delete'
  })
}

export { getimage, collection, getdelete }
